package com.yyw.bean;

import java.util.Date;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "短文表Tractate")
public class Tractate {

    @ApiModelProperty("短文ID")
    private Long id;

    @ApiModelProperty("标题")
    private String title;

    @ApiModelProperty("副标题")
    private String ftitle;

    @ApiModelProperty("难度")
    private Integer level;

    @ApiModelProperty("内容")
    private String content;

    @ApiModelProperty("创建时间")
    private Date createtime;

    // ************************

    @ApiModelProperty("读后感数量")
    private Integer criticismnum;

    @ApiModelProperty("是否收藏")
    private Boolean isCollect = false;

    public boolean checkLevel() {
        if (level == null) {
            return false;
        }
        if (level > 5 || level < 1) {
            return false;
        }
        return true;
    }
}
